#include <stdio.h>
#include <stdlib.h>

#include "array_sentinel.h"

void  set__empty(struct set* s) 
{
  s->s[0] = '\0';
  s->size = 0;
}

int set__size (const struct set * s )
{
  return s->size;
}

struct set* set__add( struct set* s, char c)
{
  if (set__find(s ,c)  == 0)
    {
      if(set__size(s) >= SET__SIZE-1)
	return NULL;
      int l = set__size (s);
      s->s[l] = c;
      s->s[l+1] = '\0';
      s->size++;
    }
  return s;
}
int  set__find(const struct set * s, char c)
{
  int k;
  int l = set__size(s);
  for (k=0; k< l;k++)
    {
      if (s->s[k] == c) 
	return 1;
    }
  return 0;
}
